package com.kemai.view
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.kemai.adapter.NestedScrollViewRvAdapter
import com.kemai.common.ui.BaseActivity

/**

 *@description:TODO
 * @author: zhaoshanshan
 * @date: 2022/12/6 4:37 下午

 */
class NestedScrollViewActivity:BaseActivity() {
    private lateinit var rv:RecyclerView
    private var adapter:NestedScrollViewRvAdapter?=null
    private lateinit var data:ArrayList<String>
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_nestedscrollview)
        setTiTle("NestedScrollView的使用")

        showContent()
    }

    override fun findViewById() {
        super.findViewById()
        createData()
        rv = findViewById(R.id.rv)
        adapter = NestedScrollViewRvAdapter(data)
    }
    private fun createData() {
        data = ArrayList<String>()
        for (i in 0 until 20){
            data.add(i.toString())
        }
    }
    fun showContent(){
        rv.layoutManager = LinearLayoutManager(this)
        rv.adapter = adapter
    }

}